const loading = {
    state:
        {loading: false},

    getters: {
        isLoading(state) {
            return state.loading;
        },

    },

    mutations: {
        updateLoading(state, loading) {
            state.loading = loading;
        }
    },

    actions: {
        showLoading(context) {
            context.commit("updateLoading", true);
        },
        hideLoading(context) {
            context.commit("updateLoading", false);

        }
    },
}
export default loading;

//调用方法
//this.$store.dispatch("asyncUpdateTest",1212);
// this.$store.getters.getTest